<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>应用模块添加</title>
    <link rel="stylesheet" type="text/css" href="${s.base}/lib/layui/css/layui.css" />
    <link rel="stylesheet" type="text/css" href="${s.base}/css/base/index.css" />
    <link rel="stylesheet" type="text/css" href="${s.base}/lib/dtree/dtree.css" />
    <link rel="stylesheet" type="text/css" href="${s.base}/lib/dtree/font/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="${s.base}/css/base/darkBlue.css"/>
</head>
<body>
<div class="page-content-wrap">
    <form class="layui-form">
        <div class="layui-tab" style="margin:0 50px 70px 30px;">
            <div class="layui-tab-content">
                <div class="layui-tab-item"></div>
                <div class="layui-tab-item layui-show">
                    <input type="hidden" class="form-control id" id="id" name="id" value="${sysVersion.id}" />

                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="red">*</span>&nbsp;版本号：</label>
                        <div class="layui-input-block">
                            <input type="text" name="versionNumber" required  lay-verify="required" placeholder="请输入版本号" value="${sysVersion.versionNumber}" autocomplete="off" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="red">*</span>&nbsp;发布内容：</label>
                        <div class="layui-input-block">
                            <input type="text" name="content" required lay-verify="required" placeholder="此次发布的内容"
                                   value="${sysVersion.content}" autocomplete="off" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="red">*</span>&nbsp;发布人员：</label>
                        <div class="layui-input-block">
                            <input type="text" name="releaseName" required lay-verify="required" placeholder="实施人员"
                                   value="${sysVersion.releaseName}" autocomplete="off" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">版本状态：</label>
                        <div class="layui-input-block">
                            <select name="status" id="status"  required  lay-verify="required">

                            </select>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="red">*</span>&nbsp;关联应用：</label>
                        <div class="layui-input-block">
                            <select name="applyId" id="applyName" required  lay-verify="required">

                            </select>
                        </div>
                    </div>

                </div>
            </div>
        </div>
        <div class="layui-form-item layui-pop-btn">
            <div class="">
                <button class="layui-btn layui-btn-normal" lay-submit lay-filter="submitBtn">提交</button>
                <button type="button" id="cancel" class="layui-btn layui-btn-primary">取消</button>
                <button type="button" style="display: none;" id="save" class="layui-btn layui-btn-primary"></button>
            </div>
        </div>
    </form>
</div>

<script src="${s.base}/lib/layui/layui.js" type="text/javascript" charset="utf-8"></script>
<script src="${s.base}/js/common.js" type="text/javascript" charset="utf-8"></script>
<script>
    layui.use(['form', 'jquery', 'laydate', 'layer', 'dialog','baseutil','page'], function() {
        var form = layui.form,
            layer = layui.layer,
            $ = layui.jquery,
            baseutil = layui.baseutil,
            dialog = layui.dialog

        var page = layui.page;
        page.initDict("base_status",function (dictData) {
           page.showDictother($("#status"), page.aceeptDictContentList(dictData, "base_status"), "",'${sysVersion.status}');

        });

        page.initDictA("1",function (dictData) {
            page.showDictother($("#applyName"), page.aceeptDictContentList(dictData, "1"), "关联的应用不能为空",'${sysVersion.applyName}');
        });

        //监听提交
        form.on('submit(submitBtn)', function(data){
            baseutil.post("/sysVersion/saveOrUpdate",data.field,function (result) {
                dialog.msg(result.data);
                $("#save").click();
            });
            return false;
        });
    });
</script>
</body>

</html>